package com.yix.study.mybatis.mapper.controller;

import com.yix.study.mybatis.mapper.entity.User;
import com.yix.study.mybatis.mapper.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {
    @Autowired
    UserMapper userMapper;

    @GetMapping("/users")
    public List<User> getAllUser(){

        return userMapper.selectAll();

    }
}
